1. Field of the Invention
The present invention relates to a method and apparatus for forwarding a packet and, in particular, to a method and apparatus for forwarding a packet and having a link aggregation capability that can increase a communication bandwidth by combining a plurality of links into one virtual logical link and prohibiting a packet received by a link having the link aggregation attribute from being forwarded to all of the links connected to the apparatus.
2. Description of the Related Art
A packet forwarding apparatus for forwarding a packet in accordance with a destination address of the packet has a capability of learning a forwarding path. The packet forwarding apparatus learns receiving positional information corresponding to a source address of the received packet. In general, the packet forwarding apparatus learns a number that identifies a port (i.e., a port number) as the receiving positional information. That is, the packet forwarding apparatus registers the latest receiving positional information for the source address of the received packet in a learning table. The packet forwarding apparatus determines the forwarding address on the basis of a destination address of the received packet using the learning table. If the packet forwarding apparatus searches the learning table and cannot find the corresponding information in the learning table, the packet forwarding apparatus forwards the packet to all of ports thereof, that is, all the ports other than the port from which the packet was received. This operation is referred to as “flooding”.
The packet forwarding apparatus learns by receiving a packet generated by flooding and resisters the learned information in the learning table. However, in general, only some of the information items in the learning table registered by flooding are used. Most of the information items in the learning table are not used, and therefore, the resource of the learning table is wasted. Accordingly, the packet forwarding apparatus deletes the information items in the learning table that are not relearned in a predetermined time period. This operation is referred to as “aging”.
For a packet forwarding apparatus having the link aggregation capability, even when one of the links packed using the link aggregation capability malfunctions, the packet forwarding apparatus can continue the operation thereof by using the other normal links. A link packed into one by the link aggregation function is referred to as a “trunk”. When the packet forwarding apparatus receives a packet via a trunk, the learning information about the receiving position of the packet is not a port number, but a number that identifies the trunk (i.e., a trunk number). Accordingly, the packet forwarding apparatus generates a link aggregation table identifying ports packed into the trunk. That is, the link aggregation table including a correspondence between a port number and a trunk number is generated. Subsequently, if the receiving positional information corresponding to the destination address in the received packet indicates a trunk on the basis of the learning result, the packet forwarding apparatus selects one port from among the ports of the link aggregation on the basis of a predetermined computation and forwards the packet to that port. The port selected from among a plurality of links, i.e., a plurality of ports of the link aggregation for forwarding depends on the predetermined computation of the packet forwarding apparatus. Accordingly, when a terminal station communicates a packet with a server via a target packet forwarding apparatus having a link aggregation attribute, the forwarding path from the terminal station to the server may be different from the forwarding path from the server to the terminal station.
In a stackable packet forwarding apparatus in which line units are stackable to allow installation of additional ports, a learning table is provided for each line unit.
When the stackable packet forwarding apparatus forwards a packet via a link included in a trunk and the link used for transmitting a packet to the target apparatus is the same as the link used for receiving a packet from the target apparatus, the occurrence of flooding can be prevented. However, when the links for receiving and transmitting a packet are different and the link aggregation is set for a plurality of line units, a line unit of the packet forwarding apparatus that has received a packet destined for a server from a terminal station may not have received a packet destined for the terminal station from the server (i.e., another line unit has received that packet). In such a case, since a learning table is provided for each line unit and the information learned by each line unit is not relearned, aging occurs. Therefore, when the packet forwarding apparatus forwards the packet via a link of the trunk again, the flooding occurs.
When forwarding a packet via a link of a trunk and the link used for transmitting a packet to the target apparatus is the same as the link for receiving a packet from the target apparatus, the occurrence of flooding can be prevented. However, if the same link is used in the trunk as the selected link for receiving and transmitting and the link malfunctions, the packet forwarding apparatus cannot continue the communication by using another normal link.
To prevent the occurrence of flooding, Japanese Unexamined Patent Application Publication No. 2005-86668, for example, describes a technique in which information in learning tables of all of line units including links of link aggregation are set to be the same. More specifically, a learning packet is sent to the line units at predetermined timings. However, sending the learning packet disadvantageously reduces a use communication bandwidth of the packet forwarding apparatus. Furthermore, the configuration of the packet forwarding apparatus is complicated in order to generate the learning packet.